home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / MPW / GCC 1.37.1r15 / Build / BuildOneStage < prev    next >
Encoding:
Text File  |  1993-04-13  |  1.5 KB  |  72 lines  |  [TEXT/MPS ]

  1. # Do one stage of GCC compilation.
  2. #
  3. # Copyright © 1990 Apple Computer, Inc.
  4.  
  5. # Grab the full pathname of this script.
  6. set thisname "{command}"
  7.  
  8. if "{2}"
  9.     set GCC "{2}"
  10. else
  11.     # Assumes that this script is sitting under the main GCC folder.
  12.     if "{thisname}" =~ /(:*([¬:]+:*)*)®1([¬:]+)/
  13.         set GCC "{®1}:"
  14.     else
  15.         # Just pick a plausible name.
  16.         set GCC "{Boot}GCC:"
  17.     end
  18. end
  19.  
  20. set exit 0  # don't give up if a match fails
  21.  
  22. set StageNumber "{1}"
  23. # set prevnum {1} - 1
  24. set Suffix ".s{StageNumber}"
  25.  
  26. Directory "{GCC}"
  27.  
  28. set Src "{GCC}GCC.MPW:"
  29.  
  30. set Stage "{GCC}GCC.MPW.s{StageNumber}:"
  31. #set PrevStage  "{GCC}GCC.MPW.s{prevnum}:"
  32.  
  33. #if StageNumber > 1 && not `Exists "{PrevStage}"`
  34. #    exit
  35. #end
  36.  
  37. echo ""
  38.  
  39. If "`Exists "{Stage}"`" != ""
  40.     echo Reusing Stage {Stage} ...
  41. else
  42.     echo Creating Stage {Stage} ...
  43.     NewFolder "{Stage}"
  44.     NewFolder "{Stage}Obj:"
  45.     NewFolder "{Stage}Tmp:"
  46.     NewFolder "{Stage}Gen:"
  47.     Duplicate "{Src}"Makefile "{Stage}"Makefile
  48.     if {StageNumber} > 1
  49.         # edit the options and C compiler name.
  50.         open "{Src}"Options{Suffix}
  51.         copy •:∞  "{Src}"Options{Suffix}
  52.         close -n "{Src}"Options{Suffix}
  53.         open "{Stage}"Makefile
  54.         find • "{Stage}"Makefile
  55.         paste /### Funky Stuff!/:/### End of Funky Stuff!/ "{Stage}"Makefile
  56.         close -y "{Stage}"Makefile
  57.     end
  58. End
  59. Directory "{Stage}"
  60. Echo ""
  61. Echo "# Building: " "{Stage}"driver
  62. BuildProgram driver
  63. Echo ""
  64. Echo "# Building: " "{Stage}"cpp
  65. BuildProgram cpp
  66. Echo ""
  67. Echo "# Building: " "{Stage}"cc1
  68. BuildProgram cc1
  69. Echo ""
  70. Echo "# Building: " "{Stage}"shorten
  71. BuildProgram shorten
  72.